package org.ling.xuan.dialog;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import org.jetbrains.annotations.Nullable;
import org.ling.xuan.entity.mo.MarkFile;
import org.ling.xuan.pannel.MarkFileListPanel;

import javax.swing.*;
import java.util.List;

public class AddFileListDialog extends DialogWrapper {
    private final MarkFileListPanel markFileListPanel;


    public AddFileListDialog(@Nullable Project project, boolean canBeParent, List<MarkFile> files, boolean unAdd) {
        super(project, canBeParent);
        setTitle("Setting Project");
        this.markFileListPanel = new MarkFileListPanel(files, unAdd);
        setSize(1200, 600);
        markFileListPanel.setSize(1200, 600);
        init();
    }

    @Override
    protected @Nullable JComponent createCenterPanel() {
        return markFileListPanel;
    }

    public List<String> getSelectIds() {
        return markFileListPanel.getSelectIds();
    }


    public void consoleSelectedFileInfo(Project project) {
        markFileListPanel.consoleSelectedFileInfo(project);
    }

    public List<String> getSelectFiles(boolean relation) {
        return markFileListPanel.getSelectFiles(relation);
    }


}
